package cn.edu.bzu.manager.computer.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Entity
@Data
@Table(name = "deliver_info", schema = "computer_component_db")
public class DeliverInfo {
    @Id
    @Column(name = "id", nullable = false)
    private int id;
    @Basic
    @Column(name = "date", nullable = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    private Date date;
    @Basic
    @Column(name = "type_id", nullable = false)
    private int typeId;
    @Basic
    @Column(name = "component_id", nullable = false)
    private int componentId;
    @Basic
    @Column(name = "quantity", nullable = false)
    private int quantity;
    @Basic
    @Column(name = "admin_id", nullable = false)
    private int adminId;
    @Transient
    private Object component;
}
